# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-applications
pkgname=akonadi-calendar
pkgver=23.08.4
pkgrel=0
pkgdesc="Akonadi calendar integration"
# armhf blocked by extra-cmake-modules
# ppc64le, s390x and riscv64 blocked by kmailtransport -> libkgapi -> qt5-qtwebengine
arch="all !armhf !ppc64le !s390x !riscv64"
url="https://community.kde.org/KDE_PIM"
license="LGPL-2.0-or-later"
depends_dev="
	akonadi-contacts-dev>=$pkgver
	akonadi-dev>=$pkgver
	kcalendarcore5-dev
	kcalutils-dev
	kcodecs5-dev
	kdbusaddons5-dev
	ki18n5-dev
	kiconthemes5-dev
	kidentitymanagement-dev
	kio5-dev
	kmailtransport-dev
	kwidgetsaddons5-dev
	kxmlgui5-dev
	messagelib-dev
	"
makedepends="$depends_dev
	extra-cmake-modules
	samurai
	"
checkdepends="xvfb-run"
_repo_url="https://invent.kde.org/pim/akonadi-calendar.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/akonadi-calendar-$pkgver.tar.xz"
subpackages="$pkgname-dev $pkgname-lang"
options="!check" # Broken

replaces="kalendar>1.0.0"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	xvfb-run ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}
sha512sums="
8677d7c4fbd15b68e57ebf8efc5ba051ab550fc99752a6751287c027c5719f812cebe7c328939ad1e900fac137b802a8f24fabd35db080a5ff406070eab33559  akonadi-calendar-23.08.4.tar.xz
"
